import 'package:flutter/material.dart';

import 'form/select_form_field.dart';

final List<SelectItem<int>> _sellMethods = [
  SelectItem(title: '全部', value: 0),
  SelectItem(title: '扫码点餐', value: 1),
  SelectItem(title: '外卖', value: 2),
];

class SellMethodsSelect extends StatelessWidget {
  final int value;
  final ValueChanged<int> onChanged;

  const SellMethodsSelect({
    Key key,
    this.value,
    this.onChanged,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SelectFormField<int>(
      title: '售卖方式',
      hintText: '请选择',
      isRequired: true,
      items: _sellMethods,
      value: value,
      onChanged: onChanged,
    );
  }
}
